<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'polls-form',
	'enableAjaxValidation'=>false,
)); ?>
<?php 
	$objSurvey = Survey::model()->getModel('LATEST-SUREVY',array());
   	 
	if (!empty($objSurvey))
	{ 
	$arranswers = explode(",",$objSurvey->html_options);
	$objSurveyID = $objSurvey->surveyID;
	$objSurveycount = $objSurvey->count;
	$objhtmlcontrols = $objSurvey->html_control;
	$objSurveycount=$objSurvey->count;
	 //print_r($objhtmlcontrols);exit;
    
?>

   <h1><?php print_r($objSurvey->survey_question);?></h1>	
   <input type="hidden" id="surveyID_hidden" name="surveyid" value="<?php echo $objSurveyID;?>">
	  <input type="hidden" id="surveycount_hidden" name="surveycount" value="<?php echo $objSurveycount;?>">
	  <input type="hidden" id="surveyq_hidden" name="surveyq" value="<?php echo $objSurvey->survey_question; ?>">
	  <input type="hidden" id="htmlcontrol" name="htmlcontrol" value="<?php echo $objhtmlcontrols; ?>">
   <?php 
        
	  
       if($objhtmlcontrols==1)
	   {
	   
         echo CHtml::RadioButtonList('html_option',$modelSurveyanswer->survey_answer,$arranswers,array('separator'=>' ')); 
	   }
	  else if($objhtmlcontrols==2)
	  {
	  echo CHtml::CheckBoxList('html_option',$modelSurveyanswer->survey_answer,$arranswers,array('separator'=>' '));
	  }
      else
	  {
	   echo Chtml::textField('html_option', $modelSurveyanswer->survey_answer);
	  }?>
	  
	  	<div class="row buttons">
		<?php //echo CHtml::submitButton('Submit',array('submit'=>'pollAnswer')); ?>
		<?php echo CHtml::submitButton('Submit', array('submit'=>ApplicationConfig::getURL("", "Surveyanswer", "surveyAnswer"))); ?>

	   </div>
	  
	 <?php }
	  else
	   { 
	    echo "sorry no polls found";
	   }
	   $this->endWidget(); 
   ?>
	 
<?php 
      
      
?>

</div><!-- form -->